<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%sys_code}}".
 *
 * @property integer $id
 * @property string $phone
 * @property integer $verifycode
 * @property integer $time
 * @property integer $status
 */
class Code extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%sys_code}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['verifycode', 'time', 'status'], 'integer'],
            [['phone'], 'string', 'max' => 32]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'phone' => 'Phone',
            'verifycode' => 'Verifycode',
            'time' => 'Time',
            'status' => 'Status',
        ];
    }

   /* public function verify($phone,$code){
            //$phone="17712354075";
            $verifyCode=new Code;
            $connection=Yii::app()->db; 
            $sql="select top 1 * from dh_sys_code where phone='".$phone."' order by time desc";
            $rows=$connection->createCommand($sql)->query();
            $list=array();
        }*/
}